<template>
	<view class="certificate">
		<view class="module-name">
			<span class="name">职业技能</span>
			<span style="margin-right: 10rpx;">:</span>
			<input type="number" placeholder="请输入您的职业技能名称" v-model="name" />
		</view>
		<view class="module-name">
			<span class="name">领证时间</span>
			<span style="margin-right: 10rpx;">:</span>
			<input @click="onShowDatePicker" type="text" placeholder="请选择您领取证书的时间" v-model="time" />
			<mx-date-picker :show="startShowPicker" :type="rangeTime" :value="vaule" :show-tips="true" :show-seconds="true"
			 @confirm="onSelected" @cancel="onSelected" />
		</view>
		<view class="uploading">
			<imgUpload :imgArr="imgArray" imgCount="6" ref="imgUpload" url="xxx(上传图片的url)"></imgUpload>
			<!-- <htz-image-upload  :max="6"  v-model="imgArray" @uploadSuccess="ceshiUploadSuccess" action="http://127.0.0.1"></htz-image-upload> -->
		</view>
		<view class="save">
			<view class="save-continue">
				保存 继续添加
			</view>
			<view class="save-message">
				确认保存
			</view>
		</view>
	</view>
</template>

<script>
	import imgUpload from '../../../components/poiuy-uImgUpload/imgUpload.vue';
	import MxDatePicker from "../../../components/mx-datepicker/mx-datepicker.vue";
	import htzImageUpload from '../../../components/htz-image-upload/htz-image-upload.vue'
	export default {
		data() {
			return {
				imgArray: [],
				startShowPicker: false,
				rangeTime: '2020/01/12',
				startTime: '',
				vaule: "",
				name: "",
				time: ""
			}
		},
		onLoad(options) {
			if(options.temp){
				let temp = JSON.parse(decodeURIComponent(options.temp))
			}
		},
		components: {
			'imgUpload': imgUpload,
			'MxDatePicker': MxDatePicker,
			'htzImageUpload':htzImageUpload
		},
		methods: {
			onShowDatePicker() { //显示
				let date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();
				this.startShowPicker = true;
				this.vaule = year + "/" + month + "/" + day
			},
			onSelected(e) { //选择
				this.startShowPicker = false;
				if (e) {
				this.time = e.value;
				}
			},
			ceshiUploadSuccess(){
				
			}
		}

	}
</script>

<style lang="scss" scoped>
	.certificate {
		background: #cecece;
		position: relative;

		.module-name {
			margin-bottom: 20rpx;
			width: 100vw;
			font-size: 30rpx;
			display: flex;
			align-items: center;
			padding: 20rpx 0 20rpx 20rpx;
			border-bottom: solid 1px #d8d8d8;
			background: #FFFFFF;
			margin-bottom: 20rpx;

			.name {
				display: inline-block;
				width: 160rpx;
				text-align-last: justify;
			}
		}

		.save {
			width: 100vw;
			display: flex;
			position: fixed;
			bottom: 0;
			right: -6rpx;
			background: #FFFFFF;
			padding: 20rpx 30rpx;

			.save-message {
				text-align: center;
				width: 45vw;
				background: #007AFF;
				color: #FFFFFF;
				font-size: 32rpx;
				padding: 14rpx 20rpx;
				border-radius: 16rpx;

			}

			.save-continue {
				text-align: center;
				width: 45vw;
				border: solid 1px #007AFF;
				color: #007AFF;
				font-size: 32rpx;
				padding: 14rpx 20rpx;
				border-radius: 16rpx;
				margin-right: 20rpx;
			}
		}

		.uploading {
			background: #FFFFFF;
		}
	}
</style>
